-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sensors dynamically based on available device state #425
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you plan to clean the state_attributes method?
def device_state_attributes(self) -> Dict[str, Any]: |
I really like this PR :) |
3bdcccb
to
ea16b0a
Compare
Lol, I haven't seen a device like this yet. Maybe we should include the device name in the sensor name as well? Is your energy sensor one device, or is this part of our merge based on subsystemid (#1 + #2 etc.) |
Yes that’s the most complex devices I own :D That’s indeed a device merging several Somfy device.
You can add by the way |
I was thinking about removing this fully eventually, especially since this is not allowed in core. However, in the mean-time it can help us spot attributes / states that we should add. |
Do you think you will have some time to finish this PR. It's a nice improvement I would like to have. |
I will take some time in the coming weeks, however I could use some help as well :). Feel free to contribute / test as well. |
Oki I will have a look too 😊 |
23a73b8
to
f959364
Compare
1152680
to
d16f11d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally. Seems to be OK. I can even now add my energy sensors within the Energy panel.
commit 9505d8c Author: Mick Vleeshouwer <Mick.Vleeshouwer@microsoft.com> Date: Tue Aug 10 02:03:19 2021 -0700 Add sensors dynamically based on available device state (#425) * Add temporary state sensor * Add extra sensors * Add more states * Add more sensors * Create supported_platforms variable * Use Overkiz label as device name * Suffix state sensor name with device index * Avoid to duplicate state key * Remove now usless rssi level attribute * Migrate LightSensor to TahomaStateSensor * Apply linters * Add PriorityLockOriginatorState sensor * Bump minimum version to 2021.8 * Remove unneeded value key * Migrate to SensorEntityDescription * Small tweaks * Add battery level * Remove unused state keys * Test electricity sensor * Add extra sensors * Add sensor * Add all sensors from sensor.py * Add smoke text sensor * Make optional * Change all sensor to new structure * Improve sensor definitions * Ease state * Ease retrieve of the index * Rollback device_state_attributes * Revert battery changes * Remove const * Add LightSensor * Rollback icon logic in cover * Bugfixes * Add round for RSSI value Co-authored-by: Thibaut Etienne <thibaut@etienne.pw> commit e7a4554 Author: Mick Vleeshouwer <Mick.Vleeshouwer@microsoft.com> Date: Tue Aug 10 01:56:39 2021 -0700 Add binary sensors dynamically based on available device state (#505) * Refactor binary sensor * Make import relative * Style fix * Update custom_components/tahoma/__init__.py Co-authored-by: Thibaut <thibaut@etienne.pw> * Add extra binary sensors * Clean for final PR * Feedback applied Co-authored-by: Thibaut <thibaut@etienne.pw> commit da5b26e Author: Mick Vleeshouwer <Mick.Vleeshouwer@microsoft.com> Date: Tue Aug 10 01:34:16 2021 -0700 Temporary bugfix for AwningValance (until this is fixed serverside) (#511) * Temporary bugfix for #486 * Add note
Fixes #223